[CI] Main2main upgrade to 0324 #7787
Conversation
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request focuses on improving compatibility between vLLM Ascend and upstream vLLM changes. It introduces several abstraction layers to handle differences in buffer management and API usage, ensuring that the Ascend backend remains functional across different versions of the core vLLM library. The changes primarily affect model runners, attention mechanisms, and configuration handling. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
Suggested PR Title:
[Attention][Ops][Worker][Misc] Enhance compatibility with upstream vLLM v0.18.0 and refactor buffer managementSuggested PR Summary:
### What this PR does / why we need it?
This PR updates the codebase to maintain compatibility with recent upstream vLLM refactoring, particularly version 0.18.0. It introduces compatibility wrappers in `NPUModelRunner` to handle the transition from `CpuGpuBuffer` to plain `Tensor` objects and provides a local implementation of `vllm_is_batch_invariant`. Additionally, it updates `kv_cache` indexing for multi-engine support and fixes potential aliasing bugs in position buffer management.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
CI passed with existing tests.I have no feedback to provide.
|
ClaudeCode fix summary: Detail fix process: |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
453b20c to
dfc18b8
Compare
8264094 to
14a1449
Compare
Signed-off-by: wangbj127 <wangbj1207@126.com>
Signed-off-by: leo-pony <nengjunma@outlook.com>
…eam, see vllm pr:35007 Signed-off-by: leo-pony <nengjunma@outlook.com>
a0dffc1 to
7fef40e
Compare
… PR:32951 Signed-off-by: leo-pony <nengjunma@outlook.com>
8c6ccbe to
43ee1a3
Compare
Signed-off-by: leo-pony <nengjunma@outlook.com>
fa3cd4d to
2c6d795
Compare
| discard_requests_mask = original_seq_lens_np < num_tokens_np | ||
| else: | ||
| discard_requests_mask = self.seq_lens.np[:num_reqs] < num_tokens_np | ||
| discard_requests_mask = self.seq_lens.cpu().numpy()[:num_reqs] < num_tokens_np |
There was a problem hiding this comment.
plz use optimistic_seq_lens_cpu instead
Signed-off-by: leo-pony <nengjunma@outlook.com>
This reverts commit 811271d.
### What this PR does / why we need it? main2main upgrade to vllm 0324. fix breaks: 1. PR [#37487](vllm-project/vllm#37487) [V0 Deprecation] Refactor kv cache from list to element (c59a132) — self.kv_cache from list[tensor](per virtual engine)changed to tensor 2. PR [#37874](vllm-project/vllm#37874) [KV Offload] Refactor CPU offloading: pluggable CachePolicy, remove Backend abstraction, restructure into cpu/ package (e3c6c10) — LRUOffloadingManager + CPUBackend been refactor to CPUOffloadingManager 3. PR [#32951](vllm-project/vllm#32951) [Async][Spec Decoding] Zero-bubble async scheduling + spec decoding (fafe76b) — a) changes self.positions and self.seq_lens from CpuGpuBuffer to plain GPU tensor; b) change _get_cumsum_and_arange output paramter. Another _prepare_input_ids add num_reqs. 5. PR [#35007](https://github.com/vllm-project/vllm/pull/35007)[Bugfix] Register VLLM_BATCH_INVARIANT in envs.py to fix spurious unknown env var warning (dc6908a) — delete vllm_is_batch_invariant() and const variable VLLM_BATCH_INVARIANT,replace with vllm.envs Know issues: 1.310p Qwen3.5 test failed for qwen3.5 patch failure, see issue: vllm-project#7976 @YangShuai52 is fixing. ### Does this PR introduce _any_ user-facing change? 1. As Zero Async Scheduler + spec decode needs _compute_slot_mapping_kernel of NPU and corresponding accepted draft token validation delaye suppots see PR vllm-project#7640 , this PR make this change: when in spec decode case close the async scheduler. In this way, the Main2Main can be developed in parallel with Spec Decode + Async scheduler, util next release version. Co-Authored-By: zhaomingyu <zhaomingyu13@h-partners.com> wangbj127 <wangbj1207@126.com> SidaoY <1024863041@qq.com> 22dimensions <waitingwind@foxmail.com> - vLLM main: vllm-project/vllm@35141a7 --------- Signed-off-by: 22dimensions <waitingwind@foxmail.com> Signed-off-by: leo-pony <nengjunma@outlook.com> Signed-off-by: Your Name <you@example.com> Signed-off-by: wangbj127 <wangbj1207@126.com> Co-authored-by: 22dimensions <waitingwind@foxmail.com> Co-authored-by: Claude Code <claude@anthropic.com> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: wangbj127 <wangbj1207@126.com> Signed-off-by: guxin108 <1252896542@qq.com>
### What this PR does / why we need it? main2main upgrade to vllm 0324. fix breaks: 1. PR [#37487](vllm-project/vllm#37487) [V0 Deprecation] Refactor kv cache from list to element (c59a132) — self.kv_cache from list[tensor](per virtual engine)changed to tensor 2. PR [#37874](vllm-project/vllm#37874) [KV Offload] Refactor CPU offloading: pluggable CachePolicy, remove Backend abstraction, restructure into cpu/ package (e3c6c10) — LRUOffloadingManager + CPUBackend been refactor to CPUOffloadingManager 3. PR [#32951](vllm-project/vllm#32951) [Async][Spec Decoding] Zero-bubble async scheduling + spec decoding (fafe76b) — a) changes self.positions and self.seq_lens from CpuGpuBuffer to plain GPU tensor; b) change _get_cumsum_and_arange output paramter. Another _prepare_input_ids add num_reqs. 5. PR [#35007](https://github.com/vllm-project/vllm/pull/35007)[Bugfix] Register VLLM_BATCH_INVARIANT in envs.py to fix spurious unknown env var warning (dc6908a) — delete vllm_is_batch_invariant() and const variable VLLM_BATCH_INVARIANT,replace with vllm.envs Know issues: 1.310p Qwen3.5 test failed for qwen3.5 patch failure, see issue: vllm-project#7976 @YangShuai52 is fixing. ### Does this PR introduce _any_ user-facing change? 1. As Zero Async Scheduler + spec decode needs _compute_slot_mapping_kernel of NPU and corresponding accepted draft token validation delaye suppots see PR vllm-project#7640 , this PR make this change: when in spec decode case close the async scheduler. In this way, the Main2Main can be developed in parallel with Spec Decode + Async scheduler, util next release version. Co-Authored-By: zhaomingyu <zhaomingyu13@h-partners.com> wangbj127 <wangbj1207@126.com> SidaoY <1024863041@qq.com> 22dimensions <waitingwind@foxmail.com> - vLLM main: vllm-project/vllm@35141a7 --------- Signed-off-by: 22dimensions <waitingwind@foxmail.com> Signed-off-by: leo-pony <nengjunma@outlook.com> Signed-off-by: Your Name <you@example.com> Signed-off-by: wangbj127 <wangbj1207@126.com> Co-authored-by: 22dimensions <waitingwind@foxmail.com> Co-authored-by: Claude Code <claude@anthropic.com> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: wangbj127 <wangbj1207@126.com>
### What this PR does / why we need it? main2main upgrade to vllm 0324. fix breaks: 1. PR [#37487](vllm-project/vllm#37487) [V0 Deprecation] Refactor kv cache from list to element (c59a132) — self.kv_cache from list[tensor](per virtual engine)changed to tensor 2. PR [#37874](vllm-project/vllm#37874) [KV Offload] Refactor CPU offloading: pluggable CachePolicy, remove Backend abstraction, restructure into cpu/ package (e3c6c10) — LRUOffloadingManager + CPUBackend been refactor to CPUOffloadingManager 3. PR [#32951](vllm-project/vllm#32951) [Async][Spec Decoding] Zero-bubble async scheduling + spec decoding (fafe76b) — a) changes self.positions and self.seq_lens from CpuGpuBuffer to plain GPU tensor; b) change _get_cumsum_and_arange output paramter. Another _prepare_input_ids add num_reqs. 5. PR [#35007](https://github.com/vllm-project/vllm/pull/35007)[Bugfix] Register VLLM_BATCH_INVARIANT in envs.py to fix spurious unknown env var warning (dc6908a) — delete vllm_is_batch_invariant() and const variable VLLM_BATCH_INVARIANT,replace with vllm.envs Know issues: 1.310p Qwen3.5 test failed for qwen3.5 patch failure, see issue: vllm-project#7976 @YangShuai52 is fixing. ### Does this PR introduce _any_ user-facing change? 1. As Zero Async Scheduler + spec decode needs _compute_slot_mapping_kernel of NPU and corresponding accepted draft token validation delaye suppots see PR vllm-project#7640 , this PR make this change: when in spec decode case close the async scheduler. In this way, the Main2Main can be developed in parallel with Spec Decode + Async scheduler, util next release version. Co-Authored-By: zhaomingyu <zhaomingyu13@h-partners.com> wangbj127 <wangbj1207@126.com> SidaoY <1024863041@qq.com> 22dimensions <waitingwind@foxmail.com> - vLLM main: vllm-project/vllm@35141a7 --------- Signed-off-by: 22dimensions <waitingwind@foxmail.com> Signed-off-by: leo-pony <nengjunma@outlook.com> Signed-off-by: Your Name <you@example.com> Signed-off-by: wangbj127 <wangbj1207@126.com> Co-authored-by: 22dimensions <waitingwind@foxmail.com> Co-authored-by: Claude Code <claude@anthropic.com> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: wangbj127 <wangbj1207@126.com> Signed-off-by: zouyida2052 <zouyida2002@gmail.com>
### What this PR does / why we need it? main2main upgrade to vllm 0324. fix breaks: 1. PR [#37487](vllm-project/vllm#37487) [V0 Deprecation] Refactor kv cache from list to element (c59a132) — self.kv_cache from list[tensor](per virtual engine)changed to tensor 2. PR [#37874](vllm-project/vllm#37874) [KV Offload] Refactor CPU offloading: pluggable CachePolicy, remove Backend abstraction, restructure into cpu/ package (e3c6c10) — LRUOffloadingManager + CPUBackend been refactor to CPUOffloadingManager 3. PR [#32951](vllm-project/vllm#32951) [Async][Spec Decoding] Zero-bubble async scheduling + spec decoding (fafe76b) — a) changes self.positions and self.seq_lens from CpuGpuBuffer to plain GPU tensor; b) change _get_cumsum_and_arange output paramter. Another _prepare_input_ids add num_reqs. 5. PR [#35007](https://github.com/vllm-project/vllm/pull/35007)[Bugfix] Register VLLM_BATCH_INVARIANT in envs.py to fix spurious unknown env var warning (dc6908a) — delete vllm_is_batch_invariant() and const variable VLLM_BATCH_INVARIANT,replace with vllm.envs Know issues: 1.310p Qwen3.5 test failed for qwen3.5 patch failure, see issue: vllm-project#7976 @YangShuai52 is fixing. ### Does this PR introduce _any_ user-facing change? 1. As Zero Async Scheduler + spec decode needs _compute_slot_mapping_kernel of NPU and corresponding accepted draft token validation delaye suppots see PR vllm-project#7640 , this PR make this change: when in spec decode case close the async scheduler. In this way, the Main2Main can be developed in parallel with Spec Decode + Async scheduler, util next release version. Co-Authored-By: zhaomingyu <zhaomingyu13@h-partners.com> wangbj127 <wangbj1207@126.com> SidaoY <1024863041@qq.com> 22dimensions <waitingwind@foxmail.com> - vLLM main: vllm-project/vllm@35141a7 --------- Signed-off-by: 22dimensions <waitingwind@foxmail.com> Signed-off-by: leo-pony <nengjunma@outlook.com> Signed-off-by: Your Name <you@example.com> Signed-off-by: wangbj127 <wangbj1207@126.com> Co-authored-by: 22dimensions <waitingwind@foxmail.com> Co-authored-by: Claude Code <claude@anthropic.com> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: wangbj127 <wangbj1207@126.com>
### What this PR does / why we need it? main2main upgrade to vllm 0324. fix breaks: 1. PR [#37487](vllm-project/vllm#37487) [V0 Deprecation] Refactor kv cache from list to element (c59a132) — self.kv_cache from list[tensor](per virtual engine)changed to tensor 2. PR [#37874](vllm-project/vllm#37874) [KV Offload] Refactor CPU offloading: pluggable CachePolicy, remove Backend abstraction, restructure into cpu/ package (e3c6c10) — LRUOffloadingManager + CPUBackend been refactor to CPUOffloadingManager 3. PR [#32951](vllm-project/vllm#32951) [Async][Spec Decoding] Zero-bubble async scheduling + spec decoding (fafe76b) — a) changes self.positions and self.seq_lens from CpuGpuBuffer to plain GPU tensor; b) change _get_cumsum_and_arange output paramter. Another _prepare_input_ids add num_reqs. 5. PR [#35007](https://github.com/vllm-project/vllm/pull/35007)[Bugfix] Register VLLM_BATCH_INVARIANT in envs.py to fix spurious unknown env var warning (dc6908a) — delete vllm_is_batch_invariant() and const variable VLLM_BATCH_INVARIANT,replace with vllm.envs Know issues: 1.310p Qwen3.5 test failed for qwen3.5 patch failure, see issue: vllm-project#7976 @YangShuai52 is fixing. ### Does this PR introduce _any_ user-facing change? 1. As Zero Async Scheduler + spec decode needs _compute_slot_mapping_kernel of NPU and corresponding accepted draft token validation delaye suppots see PR vllm-project#7640 , this PR make this change: when in spec decode case close the async scheduler. In this way, the Main2Main can be developed in parallel with Spec Decode + Async scheduler, util next release version. Co-Authored-By: zhaomingyu <zhaomingyu13@h-partners.com> wangbj127 <wangbj1207@126.com> SidaoY <1024863041@qq.com> 22dimensions <waitingwind@foxmail.com> - vLLM main: vllm-project/vllm@35141a7 --------- Signed-off-by: 22dimensions <waitingwind@foxmail.com> Signed-off-by: leo-pony <nengjunma@outlook.com> Signed-off-by: Your Name <you@example.com> Signed-off-by: wangbj127 <wangbj1207@126.com> Co-authored-by: 22dimensions <waitingwind@foxmail.com> Co-authored-by: Claude Code <claude@anthropic.com> Co-authored-by: Claude Code <noreply@anthropic.com> Co-authored-by: Your Name <you@example.com> Co-authored-by: wangbj127 <wangbj1207@126.com> Signed-off-by: nanxing <1014662416@qq.com>
What this PR does / why we need it?
main2main upgrade to vllm 0324.
fix breaks:
PR #37487 [V0 Deprecation] Refactor kv cache from list to element (c59a132) — self.kv_cache from list[tensor](per virtual engine)changed to tensor
PR #37874 [KV Offload] Refactor CPU offloading: pluggable CachePolicy, remove Backend abstraction, restructure into cpu/ package (e3c6c10) — LRUOffloadingManager + CPUBackend been refactor to CPUOffloadingManager
PR #32951 [Async][Spec Decoding] Zero-bubble async scheduling + spec decoding (fafe76b) — a) changes self.positions and self.seq_lens from CpuGpuBuffer to plain GPU tensor; b) change _get_cumsum_and_arange output paramter. Another _prepare_input_ids add num_reqs.
PR #35007[Bugfix] Register VLLM_BATCH_INVARIANT in envs.py to fix spurious unknown env var warning (dc6908a) — delete vllm_is_batch_invariant() and const variable VLLM_BATCH_INVARIANT,replace with vllm.envs
Know issues:
1.310p Qwen3.5 test failed for qwen3.5 patch failure, see issue: #7976 @YangShuai52 is fixing.
Does this PR introduce any user-facing change?
How was this patch tested?
CI
Co-Authored-By: zhaomingyu zhaomingyu13@h-partners.com
wangbj127 wangbj1207@126.com
SidaoY 1024863041@qq.com
22dimensions waitingwind@foxmail.com